#ifndef __MSG_HTTP_H__
#define __MSG_HTTP_H__
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <arpa/inet.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <errno.h>
#include <sys/shm.h>
#include <pthread.h>
#define MSG_LENGTH 1024
enum CMD
{
    GET,
    POST,
    GET_MOREN,
    GET_WUCAN,
    GET_YOUCAN,
    POST_CANSHU_DATA,
    POST_CANSHU_UP

};
enum DEVICE
{
    LED,
    BEEP
};
enum STATUE
{
    OFF,
    ON
};
struct msg
{
    int pos1;
    int pos2;
    int cmd1;
    int cmd2;
};

struct get_header
{
    int method;
    int state;
    char page[32];
    char patter[32];
};
struct post_header
{
    int method;
    int state;
    char page[32];
    char patter[32];
};
int ininit_socket();
void *message_handler(char *, int *);
void register_msg();
void get_handler();
void canshu_handler();
void post_handler();
int post_moren_handler();
int get_moren_handler();
int get_wucan_handler();
void * fun(void *arg);
int init_post_par(struct post_header *header, char *pr);
void post_handler();
int post_data_handler(int sockfd, struct post_header *header);
int post_up_handler(int sockfd, struct post_header *header);
#endif
